package cn.getech.data.development.constant;

import lombok.Getter;

import java.util.Objects;

/**
 * @Author luoxi
 * @create 2020/11/19 20:09
 */
@Getter
public enum DataSyncStatusEnum {
    SUCCESS(1,"同步成功"),
    FAIL(2,"同步失败"),
    STOP(3,"中止");

    private Integer code;

    private String message;

    DataSyncStatusEnum(Integer code,String message){
        this.code=code;
        this.message=message;
    }

    public static String getMsg(Integer code){
        if(Objects.isNull(code)){
            return "";
        }
        for (DataSyncStatusEnum value : DataSyncStatusEnum.values()) {
            if(Objects.equals(value.getCode(),code)){
                return value.getMessage();
            }
        }
        return "";
    }
}
